﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Telerik_Homework
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int N = Int32.Parse(number.Text);

            int result = Fibonacci(N);

            label1.Text = result.ToString();
        }
        private int Fibonacci(int n)
        {
            if (n == 1 || n == 0)
            {
                return n;
            }
            else
            {
                return Fibonacci(n - 2) + Fibonacci(n - 1);
            }
        }
    }
}
